 package com.oanda.blackberry.restapi;
 
 public class OrderPollResponse
 {
   long[] deleted;
   long[] updated;
   long[] created;
   long maxOrderId;
 
   public OrderPollResponse()
   {
   }
 
   public OrderPollResponse(long[] closed, long[] updated, long[] opened, long maxOrderId)
   {
     this.deleted = closed;
     this.updated = updated;
     this.created = opened;
     this.maxOrderId = maxOrderId;
   }
 
   public long[] getDeleted() {
     return this.deleted;
   }
 
   public long getMaxOrderId() {
     return this.maxOrderId;
   }
 
   public long[] getCreated() {
     return this.created;
   }
 
   public long[] getUpdated() {
     return this.updated;
   }
 
   public void setDeleted(long[] closed) {
     this.deleted = closed;
   }
 
   public void setMaxOrderId(long maxOrderId) {
     this.maxOrderId = maxOrderId;
   }
 
   public void setCreated(long[] opened) {
     this.created = opened;
   }
 
   public void setUpdated(long[] updated) {
     this.updated = updated;
   }
 
   public long getMaxOpenedId() {
     long max = 0L;
     for (int i = 0; (this.created != null) && (i < this.created.length); i++) {
       if (max < this.created[i])
         max = this.created[i];
     }
     return max;
   }
 
   public String getAllUpdatedIds() {
     StringBuffer buffer = new StringBuffer();
     for (int i = 0; (this.updated != null) && (i < this.updated.length); i++) {
       buffer.append(Long.toString(this.updated[i]));
       buffer.append(',');
     }
 
     if (buffer.length() > 1) {
       buffer = buffer.deleteCharAt(buffer.length() - 1);
     }
     return buffer.toString();
   }
}

